package net.lahuobao.enums.mall.admin;

/**
 * Created by Administrator on 2017/1/19.
 */
public enum EMallO2OOrderStatus {

    //订单状态(待支付,待使用,待评价,已评价,已取消)
    WaitPay {
        public int getStatus() {
            return 1;
        }

        public String getName() {
            return "等待付款";
        }
    },
    WaitUse {
        public int getStatus() {
            return 2;
        }

        public String getName() {
            return "已支付";
        }
    },
    Refund {
        public int getStatus() {
            return 4;
        }

        public String getName() {
            return "退款中";
        }
    },
    Finished {
        public int getStatus() {
            return 5;
        }

        public String getName() {
            return "交易完成";
        }
    },
    Settled {
        public int getStatus() {
            return 6;
        }

        public String getName() {
            return "已结算";
        }
    },
    Closed {
        public int getStatus() {
            return 99;
        }

        public String getName() {
            return "交易关闭";
        }
    },
    PayNotFinished {
        public int getStatus() {
            return 98;
        }

        public String getName() {
            return "支付未完成";
        }
    };

    public static String valueOf(int value) {
        switch (value) {
            case 1:
                return EMallO2OOrderStatus.WaitPay.getName();
            case 2:
                return EMallO2OOrderStatus.WaitUse.getName();
            case 4:
                return EMallO2OOrderStatus.Refund.getName();
            case 5:
                return EMallO2OOrderStatus.Finished.getName();
            case 6:
                return EMallO2OOrderStatus.Settled.getName();
            case 98:
                return EMallO2OOrderStatus.PayNotFinished.getName();
            case 99:
                return EMallO2OOrderStatus.Closed.getName();
        }
        return null;
    }

    public abstract int getStatus();

    public abstract String getName();
}
